Skip to content

fix race: remove metrics shutdown assignments#2452

Merged
dunglas merged 1 commit into
mainfrom
fix/race
Jun 3, 2026
Merged

fix race: remove metrics shutdown assignments#2452
dunglas merged 1 commit into
mainfrom
fix/race

Conversation

@henderkes
Copy link
Copy Markdown
Contributor

As far as I can see this is wasted anyway, because a reload leads to a new provision which always creates new ones. Requests still served on the old app shouldn't actually have their stats cleared either, I think?

@henderkes henderkes changed the title remove metrics shutdown assignments fix race: remove metrics shutdown assignments May 28, 2026
@henderkes henderkes closed this May 28, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts FrankenPHP’s Prometheus metrics shutdown behavior to avoid a race during shutdown/reload by stopping Shutdown() from mutating metric fields and from recreating/re-registering core thread metrics after unregistering them.

Changes:

  • Remove nil assignments for worker-related collectors during PrometheusMetrics.Shutdown().
  • Stop recreating and re-registering totalThreads, busyThreads, and queueDepth inside Shutdown() after unregistering them.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@dunglas dunglas merged commit 4344949 into main Jun 3, 2026
31 of 44 checks passed
@dunglas dunglas deleted the fix/race branch June 3, 2026 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants